Mule 3 to Mulesoft 4 migration, why now?
MuleSoft 3 has been a popular choice for organizations seeking to integrate their applications and systems. However, as of December 2021, MuleSoft 3 has reached its end-of-life, which means that it is no longer supported by MuleSoft. This has significant implications for organizations that are still running MuleSoft 3, as they will no longer receive security updates, bug fixes, or technical support.
As MuleSoft 3 is no longer supported, it’s critical for organizations to migrate as quickly as possible to avoid the potential for security vulnerabilities, system downtime, and other issues that could negatively impact their operations.
MuleSoft 3 to MuleSoft 4 migration doesn’t come for free and for sure not without challenges, however it offers an important range of benefits. Some of the most important are: improved performance, better scalability, and enhanced functionality, among others. Additionally, MuleSoft 4 is a more modern and future-proof platform, with a focus on cloud-native integration and the ability to take advantage of the latest innovations in technology.
In this document, we will discuss the key considerations and steps involved in migrating from MuleSoft 3 to MuleSoft 4. We will explore the changes in architecture, development practices, and deployment strategies that organizations need to be aware of when making the transition. Our goal is to provide a comprehensive guide that will help organizations to assess their migration plan to MuleSoft 4 and guarantee a smooth migration and with minimal disruption.
What’s new in Mulesoft 4?
MuleSoft 4 represents a significant upgrade from its predecessor, MuleSoft 3, in terms of architecture, development practices, and deployment strategies. Here are some of the key changes to be aware of:
-
- New architecture
MuleSoft 4 introduces a more modular and lightweight architecture compared to MuleSoft 3. It features a domain-driven design with clear separation between domains, application and runtime. The new architecture allows for better performance, scalability, and easier maintenance.
-
- New threading profile
MuleSoft 4 introduces a new threading profile, which replaces the complex and error-prone threading model of MuleSoft 3. The new UBER threading profile simplifies the management of threads, improves performance using the Proactor design pattern for asynchronous execution
-
- New Mule event structure
MuleSoft 4 introduces a new Mule event structure, which provides a more flexible and extensible way of handling messages compared to MuleSoft 3. The new event structure allows developers to easily add or remove event processors, making it easier to build complex integration flows.
-
- New error format
MuleSoft 4 introduces a new error format, which replaces the MuleSoft 3 exception model. The new error format provides more detailed information about errors, including the HTTP status code, the error message, and additional error details. This allows for better error handling and improved troubleshooting.
-
- New DataWeave 2.0
Dataweave 1.0 has been replaced by DataWeave 2.0 in Mule 4. DataWeave is a powerful, functional programming language designed specifically for data integration. It offers advanced data transformation capabilities, such as support for complex data structures, filtering, mapping, and more. DataWeave 2.0 also provides a significant performance boost over Dataweave 1.0.
-
- Deprecation of MEL script
Mule Expression Language (MEL) script has been deprecated in MuleSoft 4. Instead, developers are encouraged to use DataWeave 2.0 and other MuleSoft 4 features for data transformation and routing.
-
- Cloud-native focus
MuleSoft 4 has a strong focus on cloud-native integration, which allows organizations to take advantage of the benefits of cloud computing, such as scalability, agility, and cost-effectiveness. MuleSoft 4 includes new connectors that are optimized for cloud services such as AWS S3, AWS SQS, Azure Blob Storage and GCP PubSub and so on.
Phase 1: Discovery and Assessment
The discovery and assessment phase is a critical step that involves evaluating the current environment against a set of key indicators, and identifying the requirements and constraints of the migration.
-
- Identify the business drivers for the migration
Identify the business drivers for the migration, including the goals and objectives of the migration, the expected benefits, and any risks or challenges that need to be addressed.
-
- Discover the current environment
Start by discovering the current environment, including the version of MuleSoft being used, the integrations that are currently in place, and any other relevant information about the existing infrastructure.
-
- Assess the impact on existing integrations
Assess the impact of the migration on existing integrations, including any potential changes to the API contracts, data models, and message formats. This will help to identify any required changes to the existing integrations.
-
- Identify the required changes
Identify the changes that need to be made to the existing integrations, including any required updates to connectors, message processors, and error handling. This may also involve updating the code to conform to the new programming model of Mule 4.
Phase 2: Define a Strategy
Before embarking on a MuleSoft 4 migration, it is essential to define a strategy that outlines the goals, objectives, and approach of the migration. The strategy phase will result in a well-defined plan that outlines the migration approach, timeline, resource requirements, and expected outcomes. A well-defined strategy provides a solid foundation for the migration project.
-
- Develop a migration plan
Develop a migration plan that outlines the approach, timeline, and resources required for the migration. The plan should include a detailed assessment of the current environment, an analysis of the expected benefits and risks, and a step-by-step plan for migrating to Mule 4.
Phase 3: Adopt Build and Innovate
During this phase, the organization begins to implement the migration plan that was established in the strategy phase. The Adopt, Build, and Innovate phase is an iterative process that involves continuous development, testing, and refinement to ensure that the new platform meets the organization’s evolving needs.
-
- Define Best Practise and templates (optional – recommended)
Defining best practices and templates is an important part of promoting consistency, saving time, improving quality, ensuring compliance, and sharing knowledge across development teams.
-
- Restructure and modernize API implementations (optional – recommended)
Define a systematic approach to building robust applications following common architectural patterns like: orchestration, transformation, routing, data mapping and connectivity across systems. Starting from the existing specification (API assets), carefully plan and execute each step in the implementation process to ensure that the API meets the requirements.
Phase 4: Migration deployment
The Migration Deployment phase is critical to the success of the MuleSoft 4 migration project, as it ensures that the new system is fully operational, delivers the expected benefits, and meets the needs of the organization. The migration team will work closely with stakeholders to ensure that the new platform meets all of the organization’s requirements and that any issues that arise during the deployment are addressed promptly.
-
- Define a clear deployment plan
Before starting the deployment process, it is important to have a clear deployment plan that outlines the steps involved in the deployment process, including the deployment target, configuration settings, and deployment tools.
-
- Automate the deployment process (optional – recommended)
Automating the deployment process can help to minimize errors and reduce deployment time. This can be done using deployment tools such as Anypoint Platform or a continuous integration and continuous deployment (CI/CD) pipeline.
-
- Test and validate the migration
Develop a comprehensive testing plan that covers all aspects of the migration,including integration testing, regression testing, and performance testing. This will help to validate that the migrated integrations are functioning correctly and meeting the expected performance metrics.
-
- Develop a rollout plan to Production
Develop a rollout plan that outlines how the migrated integrations will be rolled out to production. This may involve a phased rollout to minimize the impact on users and to address any issues that arise during the rollout.
Phase 5: Monitor and governor
The Monitor and Govern phase is an ongoing process that takes place after the MuleSoft 4 migration is complete. In this phase, the organization must continually monitor and manage the new system to ensure that it performs as expected and meets the needs of the business and in addition, train the internal team on how to use the new system effectively. The Monitor and Govern phase is a critical component of the MuleSoft 4 migration process, as it ensures that the new platform delivers ongoing value and remains aligned with the organization’s evolving needs.
-
- Monitor and optimize the migrated integrations (optional)
Monitor the performance of the migrated integrations and optimize them as necessary to ensure that they are meeting the expected performance metrics.
-
- Document and share
Create clear and comprehensive documentation that outlines the API’s purpose, functionality, and usage of the new architecture, provide a clear understanding of the API ecosystem to developers, operation teams, and end-users, focused on what has been modified
-
- Training
Provide education and training on how to manage the new MuleSoft ecosystem, describing development process, new best practices for designing and building APIs, and how to use MuleSoft 4 tools and features.
A successful migration to Mule 4 requires a detailed assessment of the current environment, careful planning and execution, and ongoing monitoring and optimization. By following these steps, the organizations can take advantage of the benefits of Mule 4 and improve their integration capabilities.
Phase 1: Discovery and Assessment
This phase has been proven to be the most critical for the success of the overall migration.
Due to this consideration the approach for its completion has been detailed in this dedicated paragraph.
All the assessments will be collected and reported in a review document split per area of interest:
Section Tab |
Description |
Platform Architecture |
Focused on the configuration of the Anypoint platform |
Asset and Mulesoft architecture |
Focused application architecture as well as other systems as part of the application landscape |
Use case |
Focused on the use case and business integration flows to be migrated |
implementations and code review |
Focused on the code review including recommendations on improving the efficiency and maintainability of the system. |
The following table will be used to highlight the assessment and rating of each reviewed indicator in a visual manner:
Rating % |
Description |
90% – 100% |
A component with this rating is unlikely to significantly affect the migration process. This may be because the component is not critical to the overall architecture, or because it is relatively straightforward to migrate. While some work may be required to update the component, it is not expected to cause significant delays or issues. |
60% – 90% |
A component with this rating is moderately important to the migration process. This may be because the component is used in several integrations or because it requires some degree of customization or configuration. While the migration of this component may not be overly complex, it will require some effort and attention to ensure that it is migrated successfully. |
30% – 60% |
A component with this rating is likely to significantly affect the migration process. This may be because the component is used in critical integrations, or because it requires significant customization or configuration. Migrating this component will require significant time and effort, and may cause some delays and disruptions. Careful planning and testing will be necessary to ensure that the component is migrated successfully. |
0% – 30% |
A component with this rating is likely to have a severe impact on the migration process. This may be because the component is critical to the overall architecture or because it requires extensive customization or configuration. Migrating this component will require significant resources and may cause significant delays and disruptions to existing operations. In some cases, it may be necessary to consider alternative solutions or workarounds if the component cannot be migrated successfully. |
A higher rating value indicates a lower migration effort and conversely a lower rating means a higher complexity and greater impacts to the migration
Furthermore, an overall rating will be quantified by calculating a weighted average of all the indicators, helping to estimate the whole migration effort and identify gaps that must to be addressed in the migration design phase.
Platform Architecture Assessment
A platform architecture assessment is particularly important during a MuleSoft migration because it will drive the design decision of the new architecture ensuring that the Mulesoft 4 applications will be well-designed and capable of meeting the needs of the customer.
The platform will be evaluated against the following areas:
- Appliance
- Access Management
- Networking
- Monitoring
The current As-is configuration is compared with the desired to-be architecture and a rating score is calculated considering the impact and complexity of the transition, as describedabove, a higher rating value indicates a lower migration effort.
The following exhibit is a summary of the related tab of the Migration Assessment Document:
Ass. area |
Ass. Subjects |
As-is |
To-be |
Rating % |
Findings |
Appliance |
Deployment Model |
Cloudhub |
Cloudhub |
100% |
No impacts |
Platform version |
Cloudhub 1.0 |
Cloudhub 1.0 |
100% |
No impacts |
|
Managed extra Tools |
e.g. AnypointMQ, Titanium monitoring, ELK, etc… |
Same |
100% |
No impacts |
|
Access Management |
Business Groups |
Only 1 main BG |
No change |
100% |
easy scenario with a single BG |
Environments |
3 SBX ENVS and 1 PROD env |
No change |
90% |
Relative easy configuration |
|
External Identity Providers |
Azure AD for SSO |
Azure AD for SSO, no change |
100% |
should be no impacts |
|
External Client Providers |
Not in use |
Not in use |
100% |
no impact |
|
Roles, User and Teams |
No teams and no custom roles |
No change required |
100% |
no impact
|
|
Connected Apps |
External user managed by common user without MFA |
External user MUST be managed by connected apps |
20% |
Need to migrate all the user as connected app, refactor application code and CI/CD pipelines |
|
Networking |
VNPs |
2 VPN with Tunnel IPsec to the on-premises datacenter |
same |
100% |
common configuration, no major impact |
Transient Gateways |
No transient Gateway |
same |
100% |
no impact |
|
VPCs |
1 SBX VPC and a dedicated Prod VPC |
same |
100% |
no impact |
|
Load Balancing |
1 SBX DLB and a dedicated Prod DLB |
Same |
70% |
no version in the current routing, possible impacts on the api |
|
Monitoring |
Logging |
No log centralization, log view on the specific Cloudhub app |
Same |
100% |
no impacts |
Alerting |
No platform alerts, but though SMTP connector |
Same |
70% |
Need to migrate the SMTP connector |
|
Insights |
Insight as Cloudhub notifications |
Same |
100% |
Need to migrate Cloudhub connector |
|
Visualizer |
well configured by cloudhub properties |
Same |
80% |
Impacts on CI/CD, Properties must be managed by maven plugin |
Assets and Mulesoft Architecture
Reviewing assets and Mulesoft architecture is an important step for managing a Mulesoft 4 migration, it helps to ensure that existing integrations and the whole ecosystem are properly designed and can be successfully migrated to the new version. This allows for a smoother transition with fewer errors and less downtime. Additionally, it provides an opportunity to identify and address any potential issues or areas for improvement in the architecture before the migration takes place.
The Application landscape will be evaluated against the following area ofinterest:
- API-led connectivity
- Exchange Assets
- API Manager
- External Systems
- API Lifecycle
The assessment starts with the discovery of the existing landscape and then assesses the impacts to migrate to the new architecture, as described above, a higher rating value indicates a lower migration effort.
The following exhibit is a summary of the related tab of the Migration Assessment Document:
Ass. Area |
Ass. Subject |
AS-IS Discovery |
Rating % |
Findings |
API-led connectivity |
Reusability of the APIs |
good level of reuse, some applications have a gross-granularity |
80% |
no major impact, probably some apps will be broken down further |
Level of authentication and authorization |
basic auth between mule apps |
90% |
evaluate whether to improve security, otherwise easy to migrate |
|
Encryption of data in transit |
communication between apps in clear (http) |
70% |
strongly recommended to secure with TLS, requires self-sign certificates, |
|
Dedicated experience API per consumer |
1 exp app per API consumer |
100% |
no major impact |
|
Dedicated system API per target system |
mule apps split by functional object instead target system |
10% |
sys mule apps integrate multiple systems and technologies, changes on a system impact multiple applications, need to be refactored |
|
Dedicated process API per functional domains |
correct BSN domain and endpoint segregation |
100% |
no impacts |
|
Existing documentation |
Clear documentation |
50% |
need to be updated after sys layer refactoring |
|
Exchange Assets |
Asset census |
No extra documentation |
100% |
No impact, assets well describe themself |
API fragment externalization |
APi fragment not defined |
20% |
Common traits and datatype replicated in every API asset, need to be |
|
Dataweave modules externalization |
No Dataweave modules |
80% |
Evaluate whether if it is appropriate to define |
|
API Templates |
Well defined templates |
100% |
Mule4 will reuse existing api templates |
|
Implementation templates |
Well defined templates projects |
100% |
Positive effects to design mule4 templates |
|
Custom Connectors |
No custom connectors |
100% |
No impact |
|
Asset Documentation |
Every asset has extra documentation, bsn process |
100% |
Positive effects |
|
API Manager |
Existing Policies Custom |
Oauth 2.0 introspection |
85% |
Migrate to the existing Mule OAuth Provider Policy |
Metrics forwarding ELK |
20% |
High risk of null pointer with the new threading model Mule 4 |
||
Automated Policies |
no policies |
100% |
no impacts |
|
Client Applications and contracts |
describe client and contracts |
100% |
no impacts, implementation will inherit the existing API instances |
|
External Systems |
Logica view |
Old version, missing several systems |
40% |
Need to be |
External system census |
Complete and detailed list |
100% |
Positive effects |
|
Governance and control |
well define, get access to every system in the landscape |
100% |
No impacts |
|
API Lifecycle |
SMC technologies |
Azure DevOps Repo |
90% |
No major impact, new repository in a dedicated folder |
Branching Model |
Java JGitFlow |
100% |
no impact, reuse same model |
|
CI /CD |
Azure DevOps Pipeline |
100% |
no impact, reuse existing pipelines |
|
Artifactory Repository |
Azure DevOps Artifact |
100% |
no impact, reuse same groupId |
Use Cases
The main goal of this phase is to review all the use cases and related Business Integrations Flows.
The first step is to identify all the business use cases and group the corresponding implemented integrations into domains. This review is focused on identifying any changes that may be required to support these use cases and related integrations in Mulesoft runtime version 4.
For every Usecase, the following information are collected:
- Business Domains
- Integration Scope
- Business Requirements
And besides, the related integrations are review against the following
metrics:
- Technical Requirement
- Service Level Agreement
- Data Quality
- Performance and Scalability
- Security and Compliance
- Integration Patterns
- Test Data Preparation
- Performance Testing
- Security Testing
- Regression Testing
- Automation Testing
- Reporting and Analysis
- Existing Documentation
The following exhibit is a summary of the related tab of the Migration Assessment Document:
Use case |
Ass. Area |
Ass. Subject |
Rating % |
Findings |
Overall % |
Customer Data alignment |
General |
Business Domains |
100% |
Account and Customer objects |
77,69% |
Integration Scope |
100% |
Integrations between Salesforce API and SAP RFC ABAP…. |
|||
Business Requirements |
40% |
No BSN req. found |
|||
Integration Flow 1: Account Lookup |
Technical Requirement |
90% |
Clear technical requirement distributed across exchange and sharepoint |
86,92% |
|
Service Level Agreement |
100% |
Clear SLA, properly reported in the Sharepoint documentation |
|||
Data Quality |
100% |
Accurate, and consistent data, clear transformation and data |
|||
Performance and Scalability |
70% |
3 applications need to be scaled, high vCore consumption |
|||
Security and Compliance |
100% |
OAuth2 + 2 way SSL configured on the DLBs, no major impacts on the |
|||
Integration Patterns |
90% |
Synch API and caching strategy applied as API manager policy, no major |
|||
Test Data Preparation |
90% |
Clear test data, unit test reuse RAML specification and properly |
|||
Integration test |
70% |
Incomplete tests, only few case are tested |
|||
Performance Testing |
90% |
Performance test with JMeter and Postman |
|||
Security Testing |
40% |
No security testing, has to be implemented |
|||
Regression Testing |
100% |
comprehensive regression test library on postman |
|||
Reporting and Analysis |
100% |
Unit test result stored on dedicated sharepoint folder, reused in mule4 |
|||
Existing Documentation |
90% |
Clear documentation distributed across exchange and sharepoint |
|||
Integration Flow 2: Customer Creation |
Technical Requirement |
30% |
No clear requirements, need reverse engineering |
68,46% |
|
Service Level Agreement |
20% |
No SLA defined, must be evaluated directly in the code |
|||
Data Quality |
100% |
Accurate, and consistent data, clear transformation and data |
|||
Performance and Scalability |
80% |
Process layer can be scaled only vertically |
|||
Security and Compliance |
70% |
Secured implementation, but sensitive data logged in clear |
|||
Integration Patterns |
70% |
scheduled batch with batch scope and record aggregation |
|||
Test Data Preparation |
50% |
Clear data only for happy path |
|||
Performance Testing |
90% |
Proper testing in UAT enviroment |
|||
Performance Testing |
90% |
Proper testing in UAT enviroment |
|||
Security Testing |
70% |
No security testing, however no major impacts |
|||
Regression Testing |
100% |
comprehensive regression test library on postman |
|||
Reporting and Analysis |
100% |
Unit test result stored on dedicated sharepoint folder, reused in mule4 |
|||
Existing Documentation |
20% |
poor documentation on Exchange, no sharepoint documents |
Implementation & Code Review
This is the last phase of the assessment process, every Mule app will be reviewed against a set of evaluation metrics in order to estimate the development effort of the new Mule 4 codebase, identify impacts, and mitigate potential issues that could arise during the migration process, such as deprecated features, incompatibilities, and performance bottlenecks. Furthermore, a code review provides an opportunity to optimize the application’s performance, security, and scalability in the new Mule 4 environment
The following exhibit is a summary of the related tab of the Migration Assessment Document:
Mule Apps |
Assessment area |
Rating % |
Findings |
Overall % |
sys-salesforce-api |
API Specification (RAML/OAS) |
100% |
Clear RAML specification, no change required |
66% |
Nr of API endpoints |
50% |
About 10 synch enpoints |
||
Nr of Flows and reuse |
90% |
relatively simple implementation, about one flow per endpoint |
||
Integration patterns |
100% |
Only synch APIs |
||
APIkit to manage APIs |
0% |
no apikit, dedicated http listener per endpoint |
||
EE Connectors |
80% |
Salesforce connector HTTP requester connector |
||
Custom connectors |
100% |
no custom connectors |
||
Java classes / Groovy scripts |
60% |
Found a java class to calculate JWT token, should be migrated to |
||
Nr of unit tests |
0% |
NO unit tests, should be implemented |
||
Test coverage |
0% |
Coverage 0% |
||
Complexity |
90% |
Easy implementation with few flow processors |
||
Anti patterns |
100% |
No anti patterns found |
||
Logging |
100% |
Common logger connector, no extra configuration, easy to be |
||
Error Handling |
100% |
Externalized error handling and reuse for all the flow |
||
Existing Documentation |
20% |
Found just an high level description of the API endoints |
These are some of the topics that will be covered during the MuleSoft code review phase. However, the list may vary depending on the specific requirements and architecture of the application in exam.
Every assessment area will be appointed with a percentage rating, the average percentage of all these indicators will provide a first rough estimation of the complexity to migrate the Mule application under scrutiny.
Moreover, considering that during the migration the code will be almost completely rewritten, this would be the right time to identify any issues and technical debts that must (or should) be arranged.
Overall Consideration
In conclusion, migrating to MuleSoft 4 can offer significant benefits, such as enhanced performance, increased scalability, and improved developer productivity.
However, the migration process requires careful planning, execution, and ongoing maintenance to ensure a successful outcome.
It is essential to approach the migration process as a multi-phased project that includes all the steps described in this document.
Regarding the use of the MuleSoft Migration Assistant, it is a tool that can help simplify certain aspects of the migration process. However, it is not a complete solution, and it has limitations that make it less than ideal for some use cases. For example, the Migration Assistant may not work well for complex integrations or custom-built components. Additionally, the Migration Assistant does not provide a comprehensive migration plan or address all the aspects of a successful migration project. Therefore, it is essential to evaluate the benefits and limitations of the Migration Assistant carefully and determine if it is the best approach for your specific migration needs.
In conclusion, migrating to Mule 4 can be a complex and challenging process. This document has provided valuable information and guidance to help you navigate this transition successfully. However, if you find that you need additional assistance, we are here to help!
Our consulting services are designed to support you every step of the way, from planning to execution, to ensure a smooth and efficient migration to Mule 4 tailored to your organization’s unique needs.
Reach us out: info@florencenext.com
Author: Alberto Ferrario